Optimal. Leaf size=101 \[ \frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}-\frac {4 d^2 \text {PolyLog}\left (2,-i e^{e+f x}\right )}{a f^3}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.15, antiderivative size = 101, normalized size of antiderivative = 1.00, number of steps
used = 6, number of rules used = 6, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.261, Rules used = {3399, 4269,
3797, 2221, 2317, 2438} \begin {gather*} -\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {f x}{2}+\frac {i \pi }{4}\right )}{a f}+\frac {(c+d x)^2}{a f}-\frac {4 d^2 \text {Li}_2\left (-i e^{e+f x}\right )}{a f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 2221
Rule 2317
Rule 2438
Rule 3399
Rule 3797
Rule 4269
Rubi steps
\begin {align*} \int \frac {(c+d x)^2}{a+i a \sinh (e+f x)} \, dx &=\frac {\int (c+d x)^2 \csc ^2\left (\frac {1}{2} \left (i e+\frac {\pi }{2}\right )+\frac {i f x}{2}\right ) \, dx}{2 a}\\ &=\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}-\frac {(2 d) \int (c+d x) \coth \left (\frac {e}{2}-\frac {i \pi }{4}+\frac {f x}{2}\right ) \, dx}{a f}\\ &=\frac {(c+d x)^2}{a f}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}-\frac {(4 i d) \int \frac {e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )} (c+d x)}{1+i e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}} \, dx}{a f}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}+\frac {\left (4 d^2\right ) \int \log \left (1+i e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}\right ) \, dx}{a f^2}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}+\frac {\left (4 d^2\right ) \text {Subst}\left (\int \frac {\log (1+i x)}{x} \, dx,x,e^{2 \left (\frac {e}{2}+\frac {f x}{2}\right )}\right )}{a f^3}\\ &=\frac {(c+d x)^2}{a f}-\frac {4 d (c+d x) \log \left (1+i e^{e+f x}\right )}{a f^2}-\frac {4 d^2 \text {Li}_2\left (-i e^{e+f x}\right )}{a f^3}+\frac {(c+d x)^2 \tanh \left (\frac {e}{2}+\frac {i \pi }{4}+\frac {f x}{2}\right )}{a f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 1.58, size = 139, normalized size = 1.38 \begin {gather*} \frac {2 \left (\frac {d e^e f^2 x (2 c+d x)}{-i+e^e}-2 d f (c+d x) \log \left (1+i e^{e+f x}\right )-2 d^2 \text {PolyLog}\left (2,-i e^{e+f x}\right )+\frac {f^2 (c+d x)^2 \sinh \left (\frac {f x}{2}\right )}{\left (\cosh \left (\frac {e}{2}\right )+i \sinh \left (\frac {e}{2}\right )\right ) \left (\cosh \left (\frac {1}{2} (e+f x)\right )+i \sinh \left (\frac {1}{2} (e+f x)\right )\right )}\right )}{a f^3} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 226 vs. \(2 (90 ) = 180\).
time = 0.98, size = 227, normalized size = 2.25
method | result | size |
risch | \(\frac {2 i \left (d^{2} x^{2}+2 c d x +c^{2}\right )}{f a \left ({\mathrm e}^{f x +e}-i\right )}-\frac {4 d \ln \left ({\mathrm e}^{f x +e}-i\right ) c}{a \,f^{2}}+\frac {4 d \ln \left ({\mathrm e}^{f x +e}\right ) c}{a \,f^{2}}+\frac {2 d^{2} x^{2}}{a f}+\frac {4 d^{2} e x}{a \,f^{2}}+\frac {2 d^{2} e^{2}}{a \,f^{3}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) x}{a \,f^{2}}-\frac {4 d^{2} \ln \left (1+i {\mathrm e}^{f x +e}\right ) e}{a \,f^{3}}-\frac {4 d^{2} \polylog \left (2, -i {\mathrm e}^{f x +e}\right )}{a \,f^{3}}+\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}-i\right )}{a \,f^{3}}-\frac {4 d^{2} e \ln \left ({\mathrm e}^{f x +e}\right )}{a \,f^{3}}\) | \(227\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {Failed to integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [B] Both result and optimal contain complex but leaf count of result is larger than twice
the leaf count of optimal. 212 vs. \(2 (89) = 178\).
time = 0.38, size = 212, normalized size = 2.10 \begin {gather*} -\frac {2 \, {\left (-i \, c^{2} f^{2} + 2 i \, c d f e - i \, d^{2} e^{2} + 2 \, {\left (d^{2} e^{\left (f x + e\right )} - i \, d^{2}\right )} {\rm Li}_2\left (-i \, e^{\left (f x + e\right )}\right ) - {\left (d^{2} f^{2} x^{2} + 2 \, c d f^{2} x + 2 \, c d f e - d^{2} e^{2}\right )} e^{\left (f x + e\right )} + 2 \, {\left (-i \, c d f + i \, d^{2} e + {\left (c d f - d^{2} e\right )} e^{\left (f x + e\right )}\right )} \log \left (e^{\left (f x + e\right )} - i\right ) + 2 \, {\left (-i \, d^{2} f x - i \, d^{2} e + {\left (d^{2} f x + d^{2} e\right )} e^{\left (f x + e\right )}\right )} \log \left (i \, e^{\left (f x + e\right )} + 1\right )\right )}}{a f^{3} e^{\left (f x + e\right )} - i \, a f^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \frac {2 i c^{2} + 4 i c d x + 2 i d^{2} x^{2}}{a f e^{e} e^{f x} - i a f} - \frac {4 i d \left (\int \frac {c}{e^{e} e^{f x} - i}\, dx + \int \frac {d x}{e^{e} e^{f x} - i}\, dx\right )}{a f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \text {could not integrate} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [F]
time = 0.00, size = -1, normalized size = -0.01 \begin {gather*} \int \frac {{\left (c+d\,x\right )}^2}{a+a\,\mathrm {sinh}\left (e+f\,x\right )\,1{}\mathrm {i}} \,d x \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________